import re


def get_str_by_re(left='\\A', right='\\Z', string=''):
    result = re.search(f'{left}(.*?){right}', string)
    return result.group(1)